function diff = J_r_pp(m,param)

    % calculates J\prime\prime(m) in replacement region

    diff = param.J_rep_1*m.^(param.gamma_R_1-2).*param.gamma_R_1.*(param.gamma_R_1-1) + param.J_rep_2*m.^(param.gamma_R_2-2).*param.gamma_R_2.*(param.gamma_R_2-1) ...
            +J_0_pp_fun(m,param);
        
end